feat(posixfs): #3182 add basepath option in the "posixfs scan" command - #3191
Conversation
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 10 |
| Duplication | 0 |
🟢 Coverage 20.00% diff coverage · +0.00% coverage variation
Metric Results Coverage variation ✅ +0.00% coverage variation (-1.00%) Diff coverage ✅ 20.00% diff coverage Coverage variation details
Coverable lines Covered lines Coverage Common ancestor commit (bb8cefa) 83760 19256 22.99% Head commit (433dea4) 83813 (+53) 19269 (+13) 22.99% (+0.00%) Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch:
<coverage of head commit> - <coverage of common ancestor commit>Diff coverage details
Coverable lines Covered lines Diff coverage Pull request (#3191) 55 11 20.00% Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified:
<covered lines added or modified>/<coverable lines added or modified> * 100%
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
661e4a7 to
b1a9d81
Compare
| if err != nil { | ||
| return false, fmt.Errorf("failed to make parent directory absolute: %q: %w", parent, err) | ||
| } | ||
| absParent = filepath.Clean(absParent) |
There was a problem hiding this comment.
filepath.Abs actually calls Clean on the result before returning it, so this line is redundant and can be removed.
| if err != nil { | ||
| return false, fmt.Errorf("failed to make child file/directory absolute: %q: %w", child, err) | ||
| } | ||
| absChild = filepath.Clean(absChild) |
| } else { | ||
| return true, nil | ||
| } |
There was a problem hiding this comment.
maybe simplify this to
| } else { | |
| return true, nil | |
| } | |
| } | |
| return true, nil |
There was a problem hiding this comment.
Thanks, made the changes, they were trivial and not worth keeping in the history, so I recommitted and force-pushed.
…scan" command * add support for specifying a basepath using -p when running the posixfs scan command, to indicate a directory under which to start scanning, or a singular file to scan, as opposed to scanning from the storage root directory as is the default behaviour * implements opencloud-eu#3182
b1a9d81 to
433dea4
Compare
Description
Adds support for specifying a basepath using
-pwhen running theposixfs scancommand, to indicate a directory under which to start scanning, or a singular file to scan, as opposed to scanning from the storage root directory as is the default behaviourRelated Issue
Motivation and Context
In some scenarios, a system administrator might want to run the
posixfs scancommand under a specific subdirectory of the storage root instead of the whole tree under the storage root. This is made possible by specifying the basepath introduced with this change.How Has This Been Tested?
Tested manually in a local environment, by disabling posixfs watching (with
STORAGE_USERS_POSIX_WATCH_FSset tofalse) and then copying files into the storage, checking that they had no xattrs set on them (usinggetfattr -d), running theposixfs scancommand on them, both on individual files and on the containing directory, and then checking that OpenCloud posixfs metadata has been set on those files afterwards (again usinggetfattr -d).Types of changes
Checklist: